package com.weixing.mall.provider.controller.front;

import com.weixing.mall.base.wrapper.Result;
import com.weixing.mall.base.wrapper.ResultUtil;
import com.weixing.mall.core.support.BaseController;
import com.weixing.mall.provider.model.query.NearLocalStoreQuery;
import com.weixing.mall.provider.service.ILocalStoreService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName FrontLocalStoreController
 * @Description TODO <br/>
 * @Author gjq
 * @Modified By:
 * @Date 2019/9/18
 * @Version 1.0
 **/
@RestController
@RequestMapping("front/localStore")
@Api(value = "前端附近店铺api",tags = "前端附近店铺")
public class FrontLocalStoreController extends BaseController {

    @Autowired
    private ILocalStoreService localStoreService;

    @ApiOperation(value = "加载附近店铺")
    @GetMapping("")
    public Result list(NearLocalStoreQuery nearLocalStoreQuery){
        return ResultUtil.success(localStoreService.selectStoreOfPage(initMpPage(), nearLocalStoreQuery));
    }

    @ApiOperation(value = "查看店铺详情")
    @PostMapping("selectDetails/{id}")
    public Result selectDetails(@PathVariable long id){
        return ResultUtil.success(localStoreService.selectLocalStoreEditVoById(id));
    }
}
